#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

int cuttingRope(int n);

int main()
{
	return 0;
}

int cuttingRope(int n)
{
	if (n <= 3) return n - 1;
	int div = n / 3, rest = n % 3, res = pow(3, div) * 2;
	if		(rest == 0) res = pow(3, div);
	else if (rest == 1) res = pow(3, div - 1) * 4;

	return res;
}
